package J5_21;

import java.util.Scanner;

public class test {
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), k = in.nextInt(), d= in.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = in.nextInt();
        }
        long[][][] dp = new long[n][k][2];
        long res = Long.MIN_VALUE / 2;
        for (int i = 0; i < n; i++) {
            dp[i][0][0] = dp[i][0][1] = arr[i];
            for (int j = 1; j < k; j++) {
                if (i - j < 0) {
                    break;
                }
                int l = Math.max(0, i - d);
                long max = Long.MIN_VALUE / 2;
                long min = Long.MAX_VALUE / 2;
                for (int m = l; m <= i-1; m++) {
                    max = Math.max(max, dp[m][j-1][0]);
                    min = Math.min(min, dp[m][j-1][1]);
                }
                if(arr[i] >= 0) {
                    dp[i][j][0] = max * arr[i];
                    dp[i][j][1] = min * arr[i];
                } else {
                    dp[i][j][0] = min * arr[i];
                    dp[i][j][1] = max * arr[i];
                }
            }
            if (i >= k - 1)
            res = Math.max(res, dp[i][k-1][0]);
        }
        System.out.println(res);
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.next();
        int l = 0, r = 0;

    }
}
